<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>全部寄售</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../elementUI/index.css">
    <link rel="stylesheet" href="../../../css/index.css">
</head>

<body>
    <div id="app" class="minWidth">
        <el-form :inline="true" :form="form">

            <el-form-item>
                <!-- <span>类别:</span> -->
                <el-select clearable @change="change" v-model="form.Category_SerialNumber" placeholder="请选择类别">
                    <el-option v-for="item in category" :key="item.value" :label="item.Category_Name"
                        :value="item.Category_SerialNumber">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <!-- <span>公司:</span> -->
                <el-select clearable @change="change1" v-model="form.Enterprise_Info_SerialNumber" placeholder="请选择公司">
                    <el-option v-for="item in Enterprise" :key="item.value" :label="item.Enterprise_Name"
                        :value="item.Enterprise_Info_SerialNumber">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-input clearable v-model="form.Article_Name" placeholder="请输入商品名称" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSerach">查询</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="window.location.href = './Show.html'">我的寄售</el-button>
                <el-badge :value="badge" :max="99" :hidden="badge == 0?true:false" class="item">
                    <el-button @click="window.location.href = './Message.html'">消息</el-button>
                </el-badge>
            </el-form-item>
        </el-form>

        <el-table :data="tableData" stripe border height="calc(100vh - 140px)">
            <el-table-column align="center" label="序号" width="50" type="index"></el-table-column>
            <el-table-column align="center" prop="Picture_URL" label="商品图" width="125">
                <template v-slot="{row}">
                    <el-image v-if="row.Picture_URL != ''" style="width: 100px; height: 100px; border-radius: 9px;"
                        fit="cover" :src="DomainIMG + row.Picture_URL"></el-image>
                </template>
            </el-table-column>
            <el-table-column align="center" prop="Group_Purchasing_SerialNumber" width="100" label="商品编号"></el-table-column>
            <el-table-column align="center" prop="Article_Name" label="商品名"></el-table-column>
            <el-table-column align="center" prop="Enterprise_Name" label="卖方企业" width="350">
                <template v-slot="{row}">
                    <div style="display: flex;align-items: center;">
                        <span style="margin-right: 10px;">{{row.Enterprise_Name}}</span>
                        <el-tag type="primary" v-if="row.Enterprise_Info_SerialNumber!=Enterprise_Info_SerialNumber"
                            @click="Business(row.Enterprise_Info_SerialNumber)">点击查看</el-tag>
                    </div>
                </template>
            </el-table-column>
            <el-table-column align="center" prop="Total_Quantity" label="总数量"></el-table-column>
            <el-table-column align="center" prop="Amount" label="单价"></el-table-column>
            <el-table-column align="center" prop="Sell_Quantity" label="销售量"></el-table-column>
            <el-table-column align="center" prop="Residue_Quantity" label="剩余量"></el-table-column>
            <el-table-column align="center" prop="Starting_Quantity" label="最低购买单位"></el-table-column>
            <el-table-column align="center" prop="Contacts" label="联系人"></el-table-column>
            <el-table-column align="center" prop="Release_Type" label="状态" width="100">
                <template v-slot="{row}">
                    <el-tag v-if="row.Residue_Quantity <= 0" type="success" size="small">采购完成</el-tag>
                    <el-tag v-else type="danger" size="small">采购中</el-tag>
                </template>
            </el-table-column>
            <el-table-column align="center" label="操作" width="200" prop="Group_Purchasing_SerialNumber">
                <template v-slot="{row}">
                    <div style="display: flex;">
                        <el-tag type="info" style="margin-right: 10px;"
                            v-if="row.Enterprise_Info_SerialNumber==Enterprise_Info_SerialNumber">本企发布</el-tag>
                        <el-button type="primary" v-else
                            @click="isTransactionInstructions(row.Group_Purchasing_SerialNumber)"
                            size="small">我要竞标</el-button>
                        <el-button type="primary" @click="Seedetails(row.Group_Purchasing_SerialNumber)"
                            size="small">查看详情记录</el-button>
                    </div>
                </template>
            </el-table-column>
        </el-table>

        <el-pagination background v-show="total > 0" @size-change="handleSizeChange"
            @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10,20,30,50]"
            :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
        <el-dialog title="交易须知" :visible.sync="TransactionInstructions" width="30%" center>
            <p>1、买方在商城下单采购时，应首先熟悉商城。买方填写采购信息时，须遵守以下规定：</p>
            <p>
                （一）充分阅读并理解卖方发布的商品信息及要求，特别是对能影响交易的主要商品信息如该商品是现货销售还是商品预售、该商品的销售单价、销售数量、质量指标、付款时间与方式、交货时间、地点、方式等信息应认真阅读并准确理解。
            </p>
            <p>
                （二）买方可根据自身需求在其意向采购的商品下填写本次采购的数量。特别需要注意的是，买方仅能对采购数量进行填写，对商城展示的其他商品信息无法进行改动、变更。若买方在下单前对商品信息有其他要求，应提前与卖方沟通，经卖方修改商品信息后再行下单采购。
            </p>
            <p>（三）买方确认采购数量后，在商城填写提货人信息及发票开具信息，填写完成提交订单后，即表示买方完成了下单采购。
            <p>
                2、买方提交订单后，针对买方下单的该部分商品，即构成买方对卖方发布商品要约行为的承诺，对买方发生法律效力，买方和卖方之间对该商品的买卖合同法律关系成立并生效。买方应对其承诺行为承担法律责任，并按该商品展示的相关信息和要求进行履约。
            </p>
            <div style="text-align: center;" slot="footer" class="dialog-footer">
                <el-button @click="TransactionInstructions = false">拒 绝</el-button>
                <el-button type="primary" @click="bidding">同 意</el-button>
            </div>
        </el-dialog>
    </div>
    <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../js/vue.min.js"></script>
    <script type="text/javascript" src="../../../elementUI/index.js"></script>
    <script type="text/javascript" src="../../../js/utils.js"></script>
    <script type="text/javascript" src="./js/AllTenders.js"></script>
</body>

</html>